<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>天飞文件系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/theme.css') }}" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('dashboard') }}">文件管理系统</a>
            {% if current_user.is_authenticated %}
            <div class="navbar-nav">
                <a class="nav-item nav-link" href="{{ url_for('form_list') }}">表单</a>
                {% if current_user.is_admin %}
                <a class="nav-item nav-link" href="{{ url_for('admin_users') }}">用户管理</a>
                <a class="nav-item nav-link" href="{{ url_for('manage_years') }}">年份管理</a>
                <a class="nav-item nav-link" href="{{ url_for('manage_visibility') }}">文件可见性</a>
                {% endif %}
                <span class="nav-item nav-link">欢迎, {{ current_user.username }}</span>
                <a class="nav-item nav-link" href="{{ url_for('logout') }}">登出</a>
            </div>
            {% endif %}
        </div>
    </nav>

    <div class="container mt-4">
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    <div class="alert alert-info">{{ message }}</div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        
        {% block content %}{% endblock %}
    </div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{{ url_for('static', filename='js/main.js') }}"></script>
</body>
</html> 